<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
<title>房屋详细信息</title>
<link href="${pageContext.request.contextPath}/houseDeal/css/bootstrap.css" rel="stylesheet" type="text/css"  />
<script src="${pageContext.request.contextPath}/houseDeal/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/houseDeal/js/scripts.js"></script>
<link href="${pageContext.request.contextPath}/houseDeal/css/styles.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/houseDeal/css/style.css" rel="stylesheet" type="text/css" media="all" />	
<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/lib/layer/2.4/layer.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
// Can also be used with $(document).ready()
$(window).load(function() {
  $('.flexslider').flexslider({
    animation: "slide",
    controlNav: "thumbnails"
  });
});
</script>
<script type="text/javascript">
	    function subApply(obj){
	  			var houseId = $(obj).attr("data-houseId");
	  			var houseAgentAccount = $(obj).attr("data-houseAgentAccount");
	  			var houseAddress = $(obj).attr("data-houseAddress");
	  			var houseProvince = $(obj).attr("data-houseProvince");
	  			var houseCity = $(obj).attr("data-houseCity");
                $.ajax({
					type : "POST",
					url : '${pageContext.request.contextPath}/houseDeal/submitApply.do',
					dataType : "text",
					contentType :"application/x-www-form-urlencoded",
					data : { "houseId": houseId,
							 "houseAgentAccount":houseAgentAccount,
							 "houseAddress":houseAddress,
							 "houseProvince":houseProvince,
							 "houseCity":houseCity },
					traditional : true,
					error : function(data) {
						layer.msg("申请提交失败");
					},
					success : function(data) {
						layer.msg("申请提交成功");
					}
				});
	   		}

	</script>			
</head>
<body>
	<div class="header">
		<div class="container">
			<div class="top-nav">
				<div class="nav-icon">
					<div class="hero fa-navicon fa-2x nav_slide_button" id="hero">
						<a href="#"><i class="glyphicon glyphicon-menu-hamburger"></i>
							</a> </div>
				</div>
				<div class="clearfix"></div>
				<div id="small-dialog" class="mfp-hide">
					<div class="sap_tabs">
						<div id="horizontalTab" style="display: block; width: 100%; margin: 0px;"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
		<div class="clearfix"></div>
		<div class="container">
			<div class="buy-single-single">
				<div class="col-md-9 single-box">
					<div class=" buying-top">
						<div class="flexslider">
							<ul class="slides">
								<c:set value="${ fn:split(iHI.houseImg, '#') }" var="str1" />
								<c:forEach items="${ str1 }" var="s">
									<li
									data-thumb="${ s }">
									<img
									src="${ s }" />
								</li>
								</c:forEach>
							</ul>
						</div>
						<!-- FlexSlider -->
						<script defer
							src="${pageContext.request.contextPath}/houseDeal/js/jquery.flexslider.js"></script>
						<link rel="stylesheet"
							href="${pageContext.request.contextPath}/houseDeal/css/flexslider.css"
							type="text/css" media="screen" />
					</div>
					<div class="buy-sin-single">
						<div class="col-sm-5 middle-side immediate">
							<h4>房屋信息</h4>
							<p>
								<span class="bath4">租房类型：</span><span>${iHI.houseLayout }</span>
							</p>
							<p>
								<span class="bath4">租房面积：</span><span>${iHI.houseArea }平米</span>
							</p>
							<p>
								<span class="bath4">出租价格：</span><span>${iHI.housePrice}元</span>
							</p>
							<p>
								<span class="bath4">租房地址: </span><span>${iHI.houseAddress }</span>
							</p>
							<p>
								<span class="bath4">中介账户：</span><span>${iHI.houseAgentAccount }</span>
							</p>
							<p>
								<span class="bath4">中介电话：</span><span>${iHI.houseAgentTele}</span>
							</p>
							<div class="   right-side">
								<a href="javascript:void(0)" class="hvr-sweep-to-right more" data-houseAgentAccount="${iHI.houseAgentAccount}"
									data-houseId="${iHI.houseId}" data-houseAddress="${iHI.houseAddress}"
									data-houseProvince="${iHI.houseProvince}" data-houseCity="${iHI.houseCity}" 
								 onclick="subApply(this)">预约订房</a>
							</div>
						</div>
						<div class="col-sm-7 buy-sin">
							<h4>房主描述</h4>
							<p>${iHI.houseDesc}</p>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="map-buy-single"></div>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>

</body>
</html>
